'\" te
.\"  Copyright (c) 2001, Sun Microsystems, Inc.  All Rights Reserved
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH MKFILE 8 "Feb 20, 2008"
.SH NAME
mkfile \- create a file
.SH SYNOPSIS
.LP
.nf
\fBmkfile\fR [\fB-nv\fR] \fIsize\fR [g | k | b | m] \fIfilename\fR...
.fi

.SH DESCRIPTION
.sp
.LP
\fBmkfile\fR creates one or more files that are suitable for use as
\fBNFS-mounted\fR swap areas, or as local swap areas. When a root user executes
\fBmkfile()\fR, the sticky bit is set and the file is padded with zeros by
default.   When non-root users execute  \fBmkfile()\fR, they must manually set
the sticky bit using  \fBchmod\fR(1). The default \fBsize\fR is in bytes, but
it can be flagged as gigabytes, kilobytes, blocks, or megabytes, with the
\fBg\fR, \fBk\fR, \fBb\fR, or \fBm\fR suffixes, respectively.
.SH OPTIONS
.sp
.ne 2
.na
\fB\fB-n\fR\fR
.ad
.RS 6n
Create an empty \fIfilename\fR. The size is noted, but disk blocks are not
allocated until data is written to them. Files created with this option cannot
be swapped over local UFS mounts.
.RE

.sp
.ne 2
.na
\fB\fB-v\fR\fR
.ad
.RS 6n
Verbose.  Report the names and sizes of created files.
.RE

.SH EXIT STATUS
.sp
.LP
The following exit values are returned:
.sp
.ne 2
.na
\fB\fB0\fR\fR
.ad
.RS 6n
Success.
.RE

.sp
.ne 2
.na
\fB\fB>0\fR\fR
.ad
.RS 6n
An error occurred.
.RE

.SH USAGE
.sp
.LP
See \fBlargefile\fR(7) for the description of the behavior of \fBmkfile\fR when
encountering files greater than or equal to 2 Gbyte ( 2^31 bytes).
.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(7) for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
Interface Stability	Committed
.TE

.SH SEE ALSO
.sp
.LP
.BR chmod (1),
.BR attributes (7),
.BR largefile (7),
.BR swap (8)
